<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <style>
        body{
            width: 100%;
            height: 1200px;
        }
        header,footer{
            width: 100%;
            position: fixed;
            left: 0;
            height: 40px;
            font-size: 20px;
            line-height: 40px;
        }
        header{
            top: 0;
            background: #ccc
        }
        input{
            width: 100%;
            line-height: 40px;
            font-size: 20px;
            background: green;
            color: #fff;
        }
        footer{
            background: #000;
            color: #fff;
            bottom: 0;
        }
    </style>
    <title>Document</title>
</head>
<body>
    <header>
        <input type="text" name="" value="hi">
    </header>
    <footer>
        footer
    </footer>
    <script>
        window.onload = function () {
            var start = window.innerHeight;
            var inp = document.querySelector('input');
            var foot = document.querySelector('footer');
            inp.onfocus = function () {
                window.onresize = function () {
                    if(window.innerHeight<start){
                        foot.style.display = 'none'
                    } else{
                        foot.style.display = 'block';
                    }
                    
                }
            }
        }
    </script>
</body>
</html>